home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DIRS.SWG / 0019_Change File Attr.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-02  |  763b  |  40 lines

  1. { Updated FILES.SWG on November 2, 1993 }
  2.  
  3. {
  4. Herbert Zarb <panther!jaguar!hzarb@relay.iunet.it>
  5.  
  6.   This simple Program changes the attribute of the File or directory from
  7.    hidden to archive or vice-versa...
  8. }
  9.  
  10. Program hide_unhide;
  11. { Accepts two command line parameters :
  12.         1st parameter can be either +h (hide) or -h(unhide).
  13.         2nd parameter must be the full path }
  14. Uses
  15.   Dos;
  16.  
  17. Const
  18.   bell    = #07;
  19.   hidden  = $02;
  20.   archive = $20;
  21.  
  22. Var
  23.   f : File;
  24.  
  25. begin
  26.   if paramcount >= 2 then
  27.   begin
  28.     Assign(f, paramstr(2));
  29.     if paramstr(1) = '+h' then
  30.       SetFAttr(f, hidden)
  31.     else
  32.     if paramstr(1) = '-h' then
  33.       SetFAttr(f, Archive)
  34.     else
  35.       Write(bell);
  36.   end
  37.   else
  38.     Write(bell);
  39. end.
  40.